<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><{$TITLE}></title>
<meta name="keywords" content='<{$KEYWORDS}>'>
<meta name="description" content='<{$DESCRIPTION}>'>
<{$headers|replace:"\n":' '}>
<link rel="icon" href="<{$base_url}>favicon.ico" type="image/x-icon" />
<link rel="bookmark" href="<{$base_url}>favicon.ico" type="image/x-icon" />
<{if defined('DEBUG_CSS') && DEBUG_CSS}>
<link rel="stylesheet" href="<{$base_url}>statics/framework.css" type="text/css" />
<link rel="stylesheet" href="<{$base_url}>statics/shop.css" type="text/css" />
<link rel="stylesheet" href="<{$base_url}>statics/widgets.css" type="text/css" />
<{elseif defined('GZIP_CSS') && GZIP_CSS }>
<link rel="stylesheet" href="<{$base_url}>statics/style.zcss" type="text/css" />
<{else}>
<link rel="stylesheet" href="<{$base_url}>statics/style.css" type="text/css" />
<{/if}>
<script type="text/javascript">
var Shop = <{$shopDefine}>;
</script>
<{if defined('DEBUG_JS') && DEBUG_JS}>
<script type="text/javascript" src="<{$base_url}>statics/script_src/mootools.js"></script>
<script type="text/javascript" src="<{$base_url}>statics/script_src/jstools.js"></script>
<script type="text/javascript" src="<{$base_url}>statics/script_src/broswerstore.js"></script>
<{elseif defined('GZIP_JS') && GZIP_JS }>
<script type="text/javascript" src="<{$base_url}>statics/script/tools.jgz"></script>
<{else}>
<script type="text/javascript" src="<{$base_url}>statics/script/tools.js"></script>
<{/if}>
<script type="text/javascript">

window.addEvent('domready',function(){
			var ReferObj =new Object();
			$extend(ReferObj,{
				serverTime:<{$smarty.now}>,
				init:function(){				
        			var FIRST_REFER=Cookie.get('S[FIRST_REFER]');
					var NOW_REFER=Cookie.get('S[NOW_REFER]');				
					var nowDate=this.time=this.serverTime*1000;
					if(window.location.href.test('#r-'))Cookie.dispose('S[N]');
					if(Cookie.get('S[N]'))return;	
					if(!FIRST_REFER)
					NOW_REFER?this.writeCookie('S[FIRST_REFER]',NOW_REFER,this.getTimeOut(JSON.decode(NOW_REFER).DATE)):this.setRefer('S[FIRST_REFER]',Shop.set.refer_timeout);
					this.setRefer('S[NOW_REFER]',Shop.set.refer_timeout);
					this.createGUID();
				},
				setRefer:function(referName,timeout){				
					var lf =  window.location.href;
					var pos = lf.indexOf('#r-') + 1;
					if(pos){var uid=lf.substr(pos+3);}						
					if(document.referrer){var refer = document.referrer;}				
					if(!uid||!refer)return;
					var data={'ID':uid,'REFER':refer,'DATE':this.time};
					Cookie.set(referName,JSON.encode(data),{duration:(timeout || 15)});				
				},
				getTimeOut:function(nowDate){			
				    var timeout=nowDate+Shop.set.refer_timeout*24*3600*1000;
					var date=new Date(timeout);
					return date;
		 		},
				writeCookie:function(key,value,timeout){
					document.cookie=key+ '=' + value+'; expires=' + timeout.toGMTString();	
				},
				createGUID:function(){
					var GUID = (function(){
						var S4=function(){
							return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
						};
						return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4()).toUpperCase();
					})();
					Cookie.set('S[N]',GUID,{duration:3650});
				}
			});
			ReferObj.init();
			$('nav-main').getElements('li.menu-main').each( function( elem ){
				var list = elem.getElement('ul.links-main');	
				var myFx = new Fx.Slide(list).hide();			
				elem.addEvents({
					'mouseenter' : function(){ 					
						myFx.cancel();
						myFx.slideIn();					
					},
					'mouseleave' : function(){ 
						myFx.cancel();
						myFx.slideOut();					
					}
				});	
			})
});
    
  
  
<{if $theme_color_href}>
   window.addEvent('domready',function(){
       
       new Element('link',{href:'<{$theme_color_href}>',type:'text/css',rel:'stylesheet'}).injectBottom(document.head);
   
   });
<{/if}>
  
</script>
<{$scriptplus}>
